using System;
using IRepository;
using IServices;
using SqlSugar;
using YL.Core.Entity;
using YL.Utils.Extensions;

namespace Services
{
    public class Whr_course_applyServices : BaseServices<Whr_course_apply>, IWhr_course_applyServices 
    {
        private readonly SqlSugarClient _client;
        private readonly IWhr_course_applyRepository _repository;
        public Whr_course_applyServices(SqlSugarClient client, IWhr_course_applyRepository repository) : base(repository) 
        {
            _client = client;
            _repository = repository;
        }

        public Whr_course_apply Find(int applyId)
        {
            return _client.Queryable<Whr_course_apply>().Where(it => it.ApplyId == applyId).First();
        }

        public int GetExpire(int days)
        {
            DateTime dateTime = DateTime.Now.AddDays(days);
            return DateTimeExt.ConvertDateTimeInt(dateTime);
        }
    }
}